<?php
class test
{
    public static $game = "1";
    public $nogame = "2";

    public function __construct()
    {
        echo "get class";
    }
    public function Findme()
    {
        echo "找到我了吗？";
    }
    public function i_need_Parameter(test $game)
    {

    }
}
interface game
{

}
class test_children extends test implements game
{

}
$prod_class = new ReflectionClass('test');
$method = $prod_class->getMethod("i_need_Parameter");
$params = $method->getParameters();
//这个操作让我想起做成3个组件 然后再拼合再一起，这样就可以就可以分析和测试到整个代码
//the operation reminds me of making 3 components and then putting them together again so that  i can analyze and test  entire code
function argData(ReflectionParameter $arg)
{
    $details = "";
    $declaringClass = $arg->getDeclaringClass();
    $name = $arg->getName();
    $class = $arg->getClass();
    $position = $arg->getPosition();
    $details .= "\$$name has a position $position </br>";
    if (!empty($class)) {
        //必须有 这个类
        $classname = $class->getName();
        $details .= "\$$name  must be  a $classname object </br>";
    }
    if ($arg->isPassedByReference()) {
        $details .= "\$$name  is passed my reference </br>";
    }
    if ($arg->isDefaultValueAvailable()) {
        $def = $arg->getDefaultValue();
        $details .= "\$$name has default :$def \n";
    }
    return $details;
}
foreach ($params as $param) {
    print argData($param);  
}
?>